#include "groupaddress.h"

GroupAddress::GroupAddress()
{
    
}

int GroupAddress::getID()
{
    return id;
}

int GroupAddress::getValue()
{
    return value;
}

QString GroupAddress::getName()
{
    return name;
}

QString GroupAddress::getDescribe()
{
    return describe;
}

int GroupAddress::getUpID()
{
    return upID;
}

QString GroupAddress::getAddress()
{
    return address;
}

int GroupAddress::getType()
{
    return type;
}

void GroupAddress::setID(int _id)
{
    id = _id;
}

void GroupAddress::setValue(int _value)
{
    value = _value;
}

void GroupAddress::setName(QString _name)
{
    name = _name;
}

void GroupAddress::setDescribe(QString _describe)
{
    describe = _describe;
}

void GroupAddress::setUpID(int _upID)
{
    upID = _upID;
}

void GroupAddress::setAddress(QString _address)
{
    address = _address;
}

void GroupAddress::setType(int _type)
{
    type = _type;
}

void GroupAddress::setAll(int _id, int _value, QString _name, QString _describe, int _upID, QString _address, int _type)
{
    id= _id;
    value = _value;
    name = _name;
    describe = _describe;
    upID = _upID;
    address = _address;
    type = _type;
}

bool GroupAddress::saveAllToDB(int _id, int _value, QString _name, QString _describe, int _upID, QString _address, 
                                    int _productID, int _deviceID, int _eepromAddress, int _addressNum, int _type)
{
    return insertAddress(_id, _value, _name, _describe, _upID, _address, _productID, _deviceID, _eepromAddress, _addressNum, _type);
}

bool GroupAddress::deleteFromDB(int _id)
{
    return deleteAddressByID(_id);
}

bool GroupAddress::updateNameToDB(int _id, QString _name)
{
    return updateAddressName(_id, _name);
}

bool GroupAddress::updateDescribeToDB(int _id, QString _describe)
{
    return updateAddressDescribe(_id, _describe);
}
